Skip to content

LT-22524: Add substring search to Find Lexical Entry - #1069

Open
thejambi wants to merge 4 commits into
mainfrom
LT-22524
Open

LT-22524: Add substring search to Find Lexical Entry#1069
thejambi wants to merge 4 commits into
mainfrom
LT-22524

Conversation

@thejambi

@thejambi thejambi commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Quick Summary

Find Lexical Entry now matches typed characters anywhere in a word for queries of 3+ characters, using liblcm's new SearchType.Substring; shorter queries keep the original full-text search. The mode decision lives in a unit-tested SubstringSearchPolicy, and results retain the existing exact -> starts-with -> anywhere ordering.

Depends on sillsdev/liblcm#395

https://jira.sil.org/browse/LT-22524

CI-ready checklist

  • Commit messages follow .github/commit-guidelines.md (subject ≤ 72 chars, no trailing punctuation; if body present, blank line then ≤ 80-char lines).
  • No whitespace warnings locally:
    git fetch origin
    git log --check --pretty=format:"---% h% s" origin/<base>..
    git diff --check --cached
  • Builds/tests pass locally (or I've run the CI-style build via Bash script or MSBuild).
  • If this is core-developer AI-assisted work, I followed Docs/workflows/ai-pr-workflow.md and ran pr-preflight or the equivalent branch-readiness review before requesting review.
  • For any Src/** folders touched, corresponding AGENTS.md files are updated or explicitly confirmed still accurate.

Notes for reviewers (optional)


This change is Reviewable

Find Lexical Entry now matches typed characters anywhere in a word for
queries of 3+ characters, using liblcm's new SearchType.Substring;
shorter queries keep the original full-text search. The mode decision
lives in a unit-tested SubstringSearchPolicy, and results retain the
existing exact -> starts-with -> anywhere ordering.
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Comment hygiene (advisory)

No comment-style violations in the lines this branch adds since origin/main.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

NUnit Tests

    1 files  ± 0      1 suites  ±0   10m 23s ⏱️ -29s
5 871 tests +10  5 790 ✅ +10  81 💤 ±0  0 ❌ ±0 
5 880 runs  +10  5 799 ✅ +10  81 💤 ±0  0 ❌ ±0 

Results for commit ff11df9. ± Comparison against base commit b8f5463.

♻️ This comment has been updated with latest results.

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.78947% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.35%. Comparing base (b8f5463) to head (ff11df9).

Files with missing lines Patch % Lines
Src/LexText/LexTextControls/EntryGoDlg.cs 0.00% 15 Missing and 1 partial ⚠️
...Common/Controls/XMLViews/MatchingObjectsBrowser.cs 0.00% 7 Missing and 2 partials ⚠️
Src/LexText/LexTextControls/MergeEntryDlg.cs 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1069      +/-   ##
==========================================
- Coverage   38.35%   38.35%   -0.01%     
==========================================
  Files        1507     1508       +1     
  Lines      350617   350641      +24     
  Branches    40298    40301       +3     
==========================================
+ Hits       134471   134480       +9     
- Misses     186916   186931      +15     
  Partials    29230    29230              
Files with missing lines Coverage Δ
Src/LexText/LexTextControls/EntryGoSearchEngine.cs 46.55% <100.00%> (ø)
...c/LexText/LexTextControls/SubstringSearchPolicy.cs 100.00% <100.00%> (ø)
Src/LexText/LexTextControls/MergeEntryDlg.cs 3.89% <12.50%> (+3.89%) ⬆️
...Common/Controls/XMLViews/MatchingObjectsBrowser.cs 0.47% <0.00%> (-0.03%) ⬇️
Src/LexText/LexTextControls/EntryGoDlg.cs 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

ResetMatches now swaps the matching browser's search engine on each
query to move between full-text and substring modes. That swap always
installed an EntryGoDlg-owned engine, replacing the MergeEntryDlg engine
that excludes the starting entry. As soon as the Merge Entry dialog set
its form text (or the user typed), the starting entry reappeared in the
list and could be merged into itself.

Make the full-text and substring engine accessors virtual on EntryGoDlg
so MergeEntryDlg can supply engines that exclude the starting entry in
both modes, and drop MergeEntryDlg's InitializeMatchingObjects override
now that the base engine selection handles it.

Add tests covering the exclusion in full-text and substring modes.

Co-Authored-By: Claude <noreply@anthropic.com>
@thejambi
thejambi marked this pull request as ready for review August 26, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants